package form;

import java.awt.FlowLayout;

/**
 *
 * @author hz
 */
public class OKDialog extends javax.swing.JDialog {

    /** Creates new form DrawDialog */
    public OKDialog(java.awt.Frame parent, boolean modal, int type) {
        super(parent, modal);
        setSize(180, 64);
        if (type==0) {
        	setTitle("Game ended in a draw!");
        } else if (type==1){
        	setTitle("Draw request denied!");
        } else if (type==2){
        	setTitle("Take back request denied!");
        	setSize(210, 64);
        } else if (type==3){
        	setTitle("Opponent has disconnected!");
        	setSize(210, 64);
        } else if (type==4){
        	setTitle("Connection to host failed or host decline!");
        	setSize(280, 64);
        } else if (type==5){
        	setTitle("Opponent has resigned!");
        	setSize(210, 64);
        } else
        	setTitle("Pork chop sandwiches!!!");
        setLayout(new FlowLayout());
        initComponents();
    }
    

    private void initComponents() {
        okButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        okButton.setMnemonic('O');
        okButton.setText("Ok");
        okButton.setName("okButton"); 
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });
        add(okButton);
    }

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
        dispose();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
        	public void run() {
                OKDialog dialog = new OKDialog(new javax.swing.JFrame(), true, 0);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton okButton;
    // End of variables declaration//GEN-END:variables
}
